package com.jintoufs.domain.constants;

import sun.security.provider.MD5;

import java.security.MessageDigest;

/**
 * Created by Hyman on 2017/2/27.
 */
public class WxConstant {

    public static final String DOMAIN = "https://travel.wsinchina.com";
//    public static final String DOMAIN ="https://weixin.chenhub.cn";

    /**
     * 小程序id
     */
    public static final String APP_ID = "wx50e880b5aae6fc7d";

    /**
     * 小程序秘钥
     */
    public static final String APP_SECRET = "82083d0e9feb9247b2d0af88ad687f3d";

    public static final String APP_KEY = "8568c732e8a5cd32e6686be031ecef5c";
    /**
     * 商户号
     */
    public static final String MCH_ID = "1496855682";

    public static final String URL_UNIFIED_ORDER = "https://api.mch.weixin.qq.com/pay/unifiedorder";

    public static final String URL_REFUND_ORDER = "https://api.mch.weixin.qq.com/secapi/pay/refund";

    /**
     * 支付结果反馈消息处理接口
     */
    public static final String URL_NOTIFY = WxConstant.DOMAIN + "/api/wxpay/payBack.do";

    /**
     * 退款结果反馈消息处理接口
     */
    public static final String URL_NOTIFY_REFUND = WxConstant.DOMAIN + "/refund/notify.do";

    public static final String TIME_FORMAT = "yyyyMMddHHmmss";

    /**
     * 支付宝银行卡数据API
     */
    public static final String ALIPAY_BANK_URL = "https://ccdcapi.alipay.com/validateAndCacheCardInfo.json";
    /**
     * 支付宝银行卡LOGO API
     */
    public static final String ALIPAY_BANK_LOGO_URL = "https://apimg.alipay.com/combo.png";
    // 酒店
    public static final String ACTIVITI_TYPE_HOTEL = "0";
    // 鱼·定制
    public static final String ACTIVITI_TYPE_SCENE = "1";
    // 线路
    public static final String ACTIVITI_TYPE_TOUR = "2";

    /**
     * 两天
     */
    public static final int TIME_EXPIRE = 2;

    public static void main(String[] args) {
        try {
            String str = "weilvyou";
            MessageDigest md = MessageDigest.getInstance("MD5");
            md.update(str.getBytes());
            byte b[] = md.digest();
            int i;
            StringBuilder buf = new StringBuilder("");
            for (int offset = 0; offset < b.length; offset++) {
                i = b[offset];
                if (i < 0) {

                    i += 256;
                }
                if (i < 16) {

                    buf.append("0");
                }
                buf.append(Integer.toHexString(i));
            }
            System.out.println("MD5(" + str + ",32) = " + buf.toString());

        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}
